package com.app.service;

import com.app.common.Result;
import com.app.model.AdminUserModel;
import com.app.model.BusinessModel;
import com.app.model.OrderModel;
import com.app.model.UserModel;
import com.app.vo.OrderVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 16693103420
 * @since 2024-01-31
 */
public interface OrderService extends IService<OrderModel> {
    //用户查询订单列表
    OrderVo getUserOrderList(Integer page, Integer limit, Integer status, Integer userId, String businessName);

    //修改订单状态
    @Transactional
    String userCancelOrder(OrderModel order, UserModel userModel );

    OrderVo getBusinessOrderList(Integer page, Integer limit, Integer status, String businessName, Integer businessId, String beginTime, String endTime);
    OrderVo getBusinessOrderListUser(Integer page, Integer limit, Integer status, String businessName, Integer businessId, String beginTime, String endTime, AdminUserModel user,String areaId,String phone);

    List<OrderModel> getRollList();

    /**
     * 查找订单由业务id
     *
     * @param userId 用户id
     * @return {@link Integer}
     */
    Integer selectOrderByBusinessId(Integer userId);

    BigDecimal getTodayMyVoucher(Integer userId);

    Double incomeTime(String beginTimeDay, String endTimeDay, Integer id,Integer userId);

    Object orderCumulativeVoucherAmount(Integer status, String businessName, Integer businessId, AdminUserModel user);

    /**
     *  不同状态的订单的数量（待收货、待发货、待使用、待评价）
     * @return
     * @param id
     */
    Result OrderStatusCounts(Integer id);


    List<BusinessModel> getOrders();

    /**
     * 商家查询自己售卖的订单数
     * @param type 1查今天的 2时间不限
     * @param businessId
     * @param page
     * @param limit
     * @return
     */
    Result businessGetOrders(Integer type, Integer businessId, Integer page, Integer limit);
}
